package com.cicc.springboot.entity;

import java.io.Serializable;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.converters.doubleconverter.DoubleStringConverter;
import com.baomidou.mybatisplus.annotation.TableName;


import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;

import java.util.Date;


@Data
@NoArgsConstructor
@TableName("srm_purchase_order_item")
public class OrderItemEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @JsonProperty("id")
    @Column(name = "id")
    @ExcelIgnore
    private Long id;

    /**
     * 行项目
     */
    @JsonProperty("itemNo")
    @Column(name = "item_no")
    @ExcelProperty(value = "行项目号")
    @Excel(name = "行项目号")
    private String itemNo;

    /**
     * 行项目类型
     */
    @JsonProperty("itemType")
    @Column(name = "item_type")
    @ExcelProperty(value = "行项目类型")
    @Excel(name = "行项目类型")
    private String itemType;

    /**
     * 行状态（0.待确认1.已确认2.已拒绝）
     */
    @JsonProperty("itemState")
    @Column(name = "item_state")
    @ExcelProperty(value = "行状态")
    @ExcelIgnore
    private String itemState;

    /**
     * 物料编码
     */
    @JsonProperty("materialCode")
    @Column(name = "material_code")
    @ExcelProperty(value = "物料编码")
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料描述
     */
    @JsonProperty("materialDesc")
    @Column(name = "material_desc")
    @ExcelProperty(value = "物料描述")
    @Excel(name = "物料描述")
    private String materialDesc;

    /**
     * 单位
     */
    @JsonProperty("unit")
    @Column(name = "unit")
    @ExcelProperty(value = "单位")
    @Excel(name = "单位")
    private String unit;

    /**
     * 工厂
     */
    @JsonProperty("factory")
    @Column(name = "factory")
    @ExcelProperty(value = "采购方工厂")
    @ExcelIgnore
    private String factory;

    /**
     * 库存地点
     */
    @JsonProperty("stockLocation")
    @Column(name = "stock_location")
    @ExcelProperty(value = "库存地点")
    @Excel(name = "库存地点")
    private String stockLocation;

    /**
     * 税码
     */
    @JsonProperty("taxCode")
    @Column(name = "tax_code")
    @ExcelProperty(value = "税码")
    @Excel(name = "税码")
    private String taxCode;

    /**
     * 含税否（0.否 1.是）
     */
    @JsonProperty("taxIncludedOrNot")
    @Column(name = "tax_included_or_not")
    @ExcelProperty(value = "含税否")
    @ExcelIgnore
    private String taxIncludedOrNot;

    /**
     * 税率
     */
    @JsonProperty("taxRate")
    @Column(name = "tax_rate")
    @ExcelProperty(value = "税率", converter = DoubleStringConverter.class)
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double taxRate;

    /**
     * 采购方要求的数量
     */
    @JsonProperty("number")
    @Column(name = "number")
    @ExcelProperty(value = "数量", converter = DoubleStringConverter.class)
    @NumberFormat("#.##") //导出时才有效
    @Excel(name = "数量")
    private Double number;

    /**
     * 总价
     */
    @JsonProperty("total")
    @Column(name = "total")
    @ExcelIgnore
    private Double total;

    /**
     * 采购方要求的单价（不含税）
     */
    @JsonProperty("price")
    @Column(name = "price")
    @ExcelProperty(value = "要求的单价(不含税)", converter = DoubleStringConverter.class)
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double price;

    /**
     * 不含税价
     */
    @JsonProperty("totalNoTax")
    @Column(name = "total_no_tax")
    @NumberFormat("#.##")
    @ExcelProperty(value = "不含税价")
    @Excel(name = "不含税单价")
    private Double totalNoTax;

    /**
     * 税额
     */
    @JsonProperty("taxAmount")
    @Column(name = "tax_amount")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double taxAmount;

    /**
     * 行项目文本
     */
    @JsonProperty("itemText")
    @Column(name = "item_text")
    @ExcelIgnore
    private String itemText;

    /**
     * 收货完成
     */
    @JsonProperty("isTake")
    @Column(name = "is_take")
    @ExcelIgnore
    private String isTake;

    /**
     * 免费项目
     */
    @JsonProperty("isFree")
    @Column(name = "is_free")
    @ExcelIgnore
    private String isFree;

    /**
     * 基于收货发票校验
     */
    @JsonProperty("isCheck")
    @Column(name = "is_check")
    @ExcelIgnore
    private String isCheck;

    /**
     * 创建人
     */
    @JsonProperty("createBy")
    @Column(name = "create_by")
    @ExcelProperty(value = "创建人)")
    @ExcelIgnore
    private String createBy;

    /**
     * 修改人
     */
    @JsonProperty("updateBy")
    @Column(name = "update_by")
    @ExcelIgnore
    private String updateBy;

    /**
     * 创建时间
     */
    @JsonProperty("createTime")
    @Column(name = "create_time")
    @ExcelIgnore
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonProperty("updateTime")
    @Column(name = "update_time")
    @ExcelIgnore
    private Date updateTime;

    /**
     * 订单号
     */
    @JsonProperty("orderCode")
    @Column(name = "order_code")
    @ExcelProperty(value = "订单号", index = 0)
    @Excel(name = "订单号")
    private String orderCode;

    /**
     * 订单会计年度
     */
    @JsonProperty("orderYear")
    @Column(name = "order_year")
    @ExcelIgnore
    private String orderYear;

    /**
     * 租户ID
     */
    @JsonProperty("tenantId")
    @Column(name = "tenant_id")
    @ExcelIgnore
    private Long tenantId;

    /**
     * 删除标识
     */
    @JsonProperty("deleteFlag")
    @Column(name = "delete_flag")
    @ExcelIgnore
    private String deleteFlag;

    /**
     * 物料规格
     */
    @JsonProperty("materialSpec")
    @Column(name = "material_spec")
    @ExcelProperty(value = "物料规格")
    @Excel(name = "物料规格")
    @ExcelIgnore
    private String materialSpec;

    /**
     * 物料组
     */
    @JsonProperty("materialOrg")
    @Column(name = "material_org")
    @ExcelIgnore
    private String materialOrg;

    /**
     * 物料组描述
     */
    @JsonProperty("materialOrgDesc")
    @Column(name = "material_org_desc")
    @ExcelIgnore
    private String materialOrgDesc;

    /**
     * 采购方要求的交货日期
     */
    @JsonProperty("deliverDate")
    @Column(name = "deliver_date")
    @ExcelProperty(value = "交货日期")
    @Excel(name = "交货日期")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date deliverDate;

    /**
     * 库存类型
     */
    @JsonProperty("stockType")
    @Column(name = "stock_type")
    @ExcelIgnore
    private String stockType;

    /**
     * 退货标识
     */
    @JsonProperty("isReturn")
    @Column(name = "is_return")
    @ExcelIgnore
    private String isReturn;

    /**
     * 是否已创建退货单
     */
    @JsonProperty("returnCreated")
    @Column(name = "return_created")
    @ExcelIgnore
    private Integer returnCreated;

    /**
     * 计划行号
     */
    @Column(name = "plan_item")
    @ExcelProperty(value = "计划行号")
    @Excel(name = "计划行号")
    private String planItem;

    /**
     * 收货数量
     */
    @Column(name = "received_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double receivedQuantity;

    /**
     * 在途数量
     */
    @Column(name = "transit_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double transitQuantity;

    /**
     * 发货数量
     */
    @Column(name = "shipped_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double shippedQuantity;

    /**
     * 已叫料数量
     */
    @Column(name = "ask_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double askQuantity;

    /**
     * 最后送货日期
     */
    @Column(name = "last_send_date")
    @ExcelProperty(value = "最后送货日期")
    @ExcelIgnore
    private Date lastSendDate;

    /**
     * 合同编号
     */
    @JsonProperty("contractCode")
    @Column(name = "contract_code")
    @ExcelProperty(value = "合同编号")
    @Excel(name = "合同编号")
    private String contractCode;

    /**
     * 合同名称
     */
    @JsonProperty("contractName")
    @Column(name = "contract_name")
    @ExcelProperty(value = "合同名称")
    @Excel(name = "合同名称")
    private String contractName;

    /**
     * 叫料在途数量
     */
    @Column(name = "ask_transit_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double askTransitQuantity;

    /**
     * 叫料实收数量
     */
    @JsonProperty("ask_received_quantity")
    @Column(name = "ask_received_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double askReceivedQuantity;

    /**
     * 订单执行周期
     */
    @JsonProperty("madePeriod")
    @Column(name = "made_period")
    @ExcelIgnore
    private String madePeriod;

    /**
     * 退货数量
     */
    @JsonProperty("returnQuantity")
    @Column(name = "return_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double returnQuantity;

    /**
     * 关联租户id
     */
    @JsonProperty("refTenantId")
    @Column(name = "ref_tenant_id")
    @ExcelIgnore
    private Long refTenantId;

    /**
     * 变更状态( 0.未变更 1.已变更)
     */
    @JsonProperty("changeState")
    @Column(name = "change_state")
    @ExcelIgnore
    private String changeState;

    /**
     * 图纸批次id
     */
    @JsonProperty("batchId")
    @Column(name = "batch_id")
    @ExcelProperty(value = "图纸批次id")
    @ExcelIgnore
    private String batchId;

    /**
     * 确认时间
     */
    @JsonProperty("confirmTime")
    @Column(name = "confirm_time")
    @ExcelIgnore
    private Date confirmTime;

    /**
     * 卸货点
     */
    @JsonProperty("unloadingPoint")
    @Column(name = "unloading_point")
    @ExcelProperty(value = "卸货点")
    @Excel(name = "卸货点")
    private String unloadingPoint;

    /**
     * 供应商确认的数量
     */
    @Column(name = "confirmed_quantity")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double confirmedQuantity;

    /**
     * 供应商确认的交货日期
     */
    @JsonProperty("confirmedDeliveryDate")
    @Column(name = "confirmed_delivery_date")
    @ExcelIgnore
    private Date confirmedDeliveryDate;

    /**
     * 供应商确认的单价（不含税）
     */
    @JsonProperty("confirmedPriceWithoutTax")
    @Column(name = "confirmed_price_without_tax")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double confirmedPriceWithoutTax;

    /**
     * 供应商确认的单价（含税）
     */
    @JsonProperty("confirmedPriceWithTax")
    @Column(name = "confirmed_price_with_tax")
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double confirmedPriceWithTax;

    /**
     * 采购方要求的单价（含税）
     */
    @JsonProperty("requestedPriceWithTax")
    @Column(name = "requested_price_with_tax")
    @ExcelProperty(value = "要求的单价(含税)", converter = DoubleStringConverter.class)
    @NumberFormat("#.##")
    @ExcelIgnore
    private Double requestedPriceWithTax;

    /**
     * 工厂描述
     */
    @JsonProperty("factoryDesc")
    @Column(name = "factory_desc")
    @ExcelIgnore
    private String factoryDesc;

    /**
     * 工厂编码
     */

    @Column(name = "factory_code")
    @ExcelProperty(value = "工厂编码")
    @Excel(name = "工厂编码")
    private String factoryCode;
    /**
     * 卸货点描述
     */
    @JsonProperty("unloadingPointDesc")
    @Column(name = "unloading_point_desc")
    @ExcelIgnore
    private String unloadingPointDesc;

    @JsonProperty("unitOfMeasurement")
    @Column(name = "unit_of_measurement")
    @ExcelIgnore
    private String UnitOfMeasurement;

    @JsonProperty("packagingSpecifications")
    @Column(name = "packaging_specifications")
    @ExcelIgnore
    private String PackagingSpecifications;
}
